<%@ page language="java" pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>

<script type="text/javascript">
	function deletePhoto(elementId, photoId){
		removeElementById(elementId);
		var deletePhotoIds = document.forms[0].deletePhotoIds.value;
		if(deletePhotoIds==""){
			document.forms[0].deletePhotoIds.value = photoId;
		} else {
			document.forms[0].deletePhotoIds.value += (","+photoId);
		}
	}
</script>

<logic:notEmpty name="photoFormList">
	<div style="padding-left: 10%; height: 160px;">
		<input type="hidden" name="deletePhotoIds" />
		<input type="hidden" name="deletePhotoFilePaths" />
		<logic:iterate id="photoForm" name="photoFormList" indexId="i">
			<div id="photo${i}" style="float: left; width: 140px; height:230px;">
				<div style="text-align: center;">
					<a href="javascript:deletePhoto('photo${i}', ${photoForm.id})">[x]</a>
				</div>
				&nbsp;&nbsp;&nbsp;&nbsp;
				<img src="<%=request.getContextPath()%>${photoForm.url}" width="100" />
				<br />
				顺序号&nbsp;&nbsp;<html:text property="photoSeqs[${i}]" value="${photoForm.seq}" size="3" />
				<br />
				<html:text property="photoDeses[${i}]" value="${photoForm.des}" size="18" />
				<html:hidden property="photoIds[${i}]" value="${photoForm.id}" />
			</div>
		</logic:iterate>
	</div>
</logic:notEmpty>
<table>
	<tr>
		<td class="td30">
			图片描述:
		</td>
		<td class="td70">
			<html:text property="newPhotoDeses[0]"></html:text>
			&nbsp;&nbsp; 图片路径:&nbsp;
			<html:file property="newPhotoFiles[0]"></html:file>
		</td>
	</tr>
	<tr>
		<td class="td30">
			图片描述:
		</td>
		<td class="td70">
			<html:text property="newPhotoDeses[1]"></html:text>
			&nbsp;&nbsp; 图片路径:&nbsp;
			<html:file property="newPhotoFiles[1]"></html:file>
		</td>
	</tr>
	<tr>
		<td class="td30">
			图片描述:
		</td>
		<td class="td70">
			<html:text property="newPhotoDeses[2]"></html:text>
			&nbsp;&nbsp; 图片路径:&nbsp;
			<html:file property="newPhotoFiles[2]"></html:file>
		</td>
	</tr>
	<tr>
		<td class="td30">
			图片描述:
		</td>
		<td class="td70">
			<html:text property="newPhotoDeses[3]"></html:text>
			&nbsp;&nbsp; 图片路径:&nbsp;
			<html:file property="newPhotoFiles[3]"></html:file>
		</td>
	</tr>
	<tr>
		<td class="td30">
			图片描述:
		</td>
		<td class="td70">
			<html:text property="newPhotoDeses[4]"></html:text>
			&nbsp;&nbsp; 图片路径:&nbsp;
			<html:file property="newPhotoFiles[4]"></html:file>
		</td>
	</tr>
</table>